import { Form } from 'antd'
import http from '../utils/http'

const BASE_URL = 'http://192.168.221.213:8002'

// 满减满折查询
export default {
    // 查所有
    getfullData(obj) {
        return http({
            url: `${BASE_URL}/service_market/findAllFullDiscount`,
            method: 'post',
            data: {
                ...obj
            }
        })
    },
    // 编辑
    editfullData() {
        return http({
            url: `${BASE_URL}/Service_market/updateFullFreeShipping`,
            method: 'post',
            data: {

            }
        })
    },
    // 添加
    addfullData(obj) {
        return http({
            url: `${BASE_URL}/service_market/insertFullDiscount`,
            method: 'post',
            data: obj

        })
    },
    // 停用
    stopfullData(fullDecreaseId) {
        return http({
            url: `${BASE_URL}/service_market/updateFullDiscountState`,
            method: 'post',
            data: { fullDecreaseId }
        })
    },
    // 选择商品API
    choseproduct(obj) {
        return http({
            url: `${BASE_URL}/service_market/selectGoods`,
            method: 'post',
            data: obj

        })
    },
    // 满包邮  查询
    findAllFullFreeShipping(obj) {
        return http({
            url: `${BASE_URL}/service_market/findAllFullFreeShipping`,
            method: 'post',
            data: { ...obj }
        })
    },
    // 满包邮  添加
    insertFullFreeShipping(obj) {
        return http({
            url: `${BASE_URL}/service_market/insertFullFreeShipping`,
            method: 'post',
            data: obj
        })
    },
    // 满包邮  编辑
    updateFullFreeShipping(obj) {
        return http({
            url: `${BASE_URL}/service_market/updateFullFreeShipping`,
            method: 'post',
            data: { ...obj }
           
        })
    },
    // 停用
    updateFullFreeShippingState(freeShippingId) {
        return http({
            url: `${BASE_URL}/service_market/updateFullFreeShippingState`,
            method: 'post',
            data: { freeShippingId }
        })
    },

      // 满赠  查询
      findAllFullReduction(obj) {
        return http({
            url: `${BASE_URL}/service_market/findAllFullReduction`,
            method: 'post',
            data: { ...obj }
        })
    },
    // 满赠  添加
    insertFullReduction(obj) {
        return http({
            url: `${BASE_URL}/service_market/insertFullReduction`,
            method: 'post',
            data: obj
        })
    },
    // 满赠 编辑
    updateFullReduction(obj) {
        return http({
            url: `${BASE_URL}/service_market/updateFullReduction`,
            method: 'post',
            data: { ...obj }
        })
    },
    //满赠 停用
    updateFullReductionState(fullDecreaseId) {
        return http({
            url: `${BASE_URL}/service_market/updateFullReductionState`,
            method: 'post',
            data: { fullDecreaseId }
        })
    },
}
